package com.veng.springbootdemo.controller;

import com.veng.springbootdemo.service.UserInfoService;
import com.veng.springbootdemo.utils.ResponseUtils;
import com.veng.springbootdemo.vo.UserInfoVo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;


@RestController
public class HomeController {
    @Autowired
    private UserInfoService userInfoService;

    @GetMapping(value = "userList")
    @RequiresPermissions("userInfo:view")
    public Map userList(){
        List<UserInfoVo> all = userInfoService.findAll();
        return ResponseUtils.toJson(200, "用户列表", all);
    }
}
